@model CharacterIndexModel
@{
    ViewBag.Title = "Character";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Index</h2>
<ul>
@foreach (var character in Model.Characters) {
    <li>
        <p><strong>@character.Name</strong></p>
        <p><img src="@Url.Content(character.Image)" alt="@character.Name" title="" /></p>
        <p>Traits:</p>
        <ul>
        @foreach (var trait in character.CharacterTraits) {
            <li>@trait.Trait.Name@(trait.TraitVariation != null ? ": " + trait.TraitVariation.Name : "")</li>
        }
        </ul>
            
        <p>Questions that will answer 'yes':</p>
        <ul>
        @foreach (var trait in character.CharacterTraits) {
            <li>@trait.Trait.QuestionFormat.Replace("{variation}", trait.TraitVariation != null ? trait.TraitVariation.Name : "")</li>
        }
        </ul>
    </li>
}
</ul>